Skip to content

Better defaults for sea_ice_simulation #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jun 3, 2025
Merged

Conversation

simone-silvestri
Copy link
Collaborator

@simone-silvestri simone-silvestri commented May 22, 2025

the new interface will be

ocean = ocean_simulation(grid)
seaice = sea_ice_simulation(grid, ocean)

alternatively, to change the sea ice dynamics

ocean = ocean_simulation(grid)
dynamics = sea_ice_dynamics(grid, ocean; rheology=ElastoViscoPlasticRheology(), solver=SplitExplicitSolver(200), coriolis= ..., kwargs....)
seaice = sea_ice_simulation(grid, ocean; dynamics)

@simone-silvestri
Copy link
Collaborator Author

Requires a new version of ClimaSeaIce which I am waiting for CliMA/ClimaSeaIce.jl#73 and CliMA/ClimaSeaIce.jl#72 to release

@glwagner
Copy link
Member

What was the old interface?

@simone-silvestri
Copy link
Collaborator Author

simone-silvestri commented May 23, 2025

The old interface requires building the dynamics and the bottom boundary condition manually in the script because the ocean is not passed to sea_ice_simulation. A typical sea ice model construction looks like this:

SSS = view(ocean.model.tracers.S.data, :, :, grid.Nz)
bottom_heat_boundary_condition = IceWaterThermalEquilibrium(SSS)

SSU = view(ocean.model.velocities.u, :, :, grid.Nz)
SSV = view(ocean.model.velocities.v, :, :, grid.Nz)
coriolis = ocean.model.coriolis

τo  = SemiImplicitStress(uₑ=SSU, vₑ=SSV, Cᴰ=sea_ice_ocean_drag_coefficient)
τua = Field{Face, Center, Nothing}(grid)
τva = Field{Center, Face, Nothing}(grid)

dynamics = SeaIceMomentumEquation(grid;
                                  coriolis,
                                  top_momentum_stress = (u=τua, v=τva),
                                  bottom_momentum_stress = τo,
                                  rheology = ElastoViscoPlasticRheology(),
                                  solver = SplitExplicitSolver(150))

sea_ice = sea_ice_simulation(grid; bottom_heat_boundary_condition, dynamics, advection=WENO(order=7))

@glwagner
Copy link
Member

The old interface requires building the dynamics and the bottom boundary condition manually in the script because the ocean is not passed to sea_ice_simulation. A typical sea ice model construction looks like this:

SSS = view(ocean.model.tracers.S.data, :, :, grid.Nz)
bottom_heat_boundary_condition = IceWaterThermalEquilibrium(SSS)

SSU = view(ocean.model.velocities.u, :, :, grid.Nz)
SSV = view(ocean.model.velocities.v, :, :, grid.Nz)
coriolis = ocean.model.coriolis

τo  = SemiImplicitStress(uₑ=SSU, vₑ=SSV, Cᴰ=sea_ice_ocean_drag_coefficient)
τua = Field{Face, Center, Nothing}(grid)
τva = Field{Center, Face, Nothing}(grid)

dynamics = SeaIceMomentumEquation(grid;
                                  coriolis,
                                  top_momentum_stress = (u=τua, v=τva),
                                  bottom_momentum_stress = τo,
                                  rheology = ElastoViscoPlasticRheology(),
                                  solver = SplitExplicitSolver(150))

sea_ice = sea_ice_simulation(grid; bottom_heat_boundary_condition, dynamics, advection=WENO(order=7))

okay great, and I think it makes sense that this lives in ClimaOcean where we are doing the coupling. Possibly there will be other changes down the line to make stand-alone modeling easier with ClimaSeaIce (if that still makes sense even)

Copy link

codecov bot commented Jun 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Project coverage is 14.18%. Comparing base (1e17afc) to head (327146a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/SeaIceSimulations.jl 0.00% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #535      +/-   ##
==========================================
- Coverage   14.29%   14.18%   -0.11%     
==========================================
  Files          48       48              
  Lines        2812     2833      +21     
==========================================
  Hits          402      402              
- Misses       2410     2431      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@simone-silvestri
Copy link
Collaborator Author

I ll merge this because we also need it to capture the change of syntax of https://github.com/CliMA/ClimaSeaIce.jl/releases/tag/v0.3.0

@simone-silvestri simone-silvestri merged commit 42bc765 into main Jun 3, 2025
25 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants